using System.Collections.Generic;

public class Table_GlobalDialogItem
{
    /// <summary>
    /// 唯一ID
    /// <summary>
    public int Id { get; private set; }
    /// <summary>
    /// 对话框类型
    /// <summary>
    public int TipType { get; private set; }
    /// <summary>
    /// 对话标题ID
    /// <summary>
    public int Title { get; private set; }
    /// <summary>
    /// 内容ID
    /// <summary>
    public int ContentId { get; private set; }
    /// <summary>
    /// 按钮文本ID
    /// <summary>
    public int GetBtnNameCount() { return BtnName.Count; }
    private List<int> BtnName = new List<int>();
    public int GetBtnNamebyIndex(int idx)
    {
        return BtnName.GetValueByIdx(idx, 0);
    }
    /// <summary>
    /// 是否显示关闭
    /// <summary>
    public bool TapClose { get; private set; }

    public Table_GlobalDialogItem(ExcelLineReader reader)
    {
        Id = reader.ReadInt();
        TipType = reader.ReadInt();
        Title = reader.ReadInt();
        ContentId = reader.ReadInt();
        BtnName = reader.ReadShortString().ToIntList(";");
        TapClose = reader.ReadBool();
    }
}

public class Table_GlobalDialogMgr : IDataMgr
{
    protected override string FileName { get { return "Txt/GlobalDialog.txt"; } }

    protected List<Table_GlobalDialogItem> mItemList = new List<Table_GlobalDialogItem>();
    public Table_GlobalDialogItem GetItemByIdx(int idx)
    {
        return mItemList[idx];
    }
    public Table_GlobalDialogItem GetItemById(int id)
    {
        int idx = GetIdxById(id);
        return GetItemByIdx(idx);
    }

    public override void Load(ExcelLineReader reader)
    {
        var item = new Table_GlobalDialogItem(reader);
        mItemDic.Add(item.Id, mDataCount);
        mItemList.Add(item);
    }
}